<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Mining_model extends CI_Model {

    public function __construct() {
        parent::__construct();
    }

    function total_cuestionarios() {
        $query = "  select sum(c) as tc
from (	select count(c_cuestionario_id) as c from cuestionario
		union
		select count(d_dh_id)  from dh
		union
		select count(c_consultec_id) from consultec ) as a";
        $resultado = $this->db->query($query);
        $out = $resultado->row();
        $resultado->next_result();
        $resultado->free_result();
        return $out;
    }

    function total_preguntas() {
        $query = "  select sum(c) as tc
                    from (	select count(*) as c from calificacion
                                    union
                                    select count(*)  from atributo_evaluado
                                    union
                                    select count(*) from calificacion_pca ) as a";
        $resultado = $this->db->query($query);
        $out = $resultado->row();
        $resultado->next_result();
        $resultado->free_result();
        return $out;
    }

}
